/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.analysisModel;

import java.io.Serializable;
import java.util.ArrayList;

import br.ufmg.dees.insane.util.IMatrix;
import br.ufmg.dees.insane.util.IVector;
import br.ufmg.dees.insane.util.pointValues.PointValues;
import br.ufmg.dees.insane.util.pointValues.StringPointValues;

/** A class representing analysis model referring to the
 *  rectangular plate-bending element nonconforming of 
 *  four node developed by Melosh, Zienkiewicz and Cheung,
 *  called MZC.
 * @author Samir
 * @since 26/07/2006
 */
public class MZCKirchhoffPlate extends KirchhoffPlate implements Serializable {
	
	private static final long serialVersionUID = 1L;

	public MZCKirchhoffPlate(){
	}

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getInternalVariableOperator(br.ufmg.dees.insane.util.IMatrix, br.ufmg.dees.insane.util.IVector, br.ufmg.dees.insane.util.IMatrix)
     */
    public IMatrix getInternalVariableOperator(IMatrix d, IMatrix d2, IVector n, IMatrix c){
        IMatrix B = new IMatrix(3, n.getSize());
        B.setZero();
        for(int i = 0; i < n.getSize(); i++){
            B.setElement(0,i,(-d2.getElement(0,i)));
            B.setElement(1,i,(-d2.getElement(1,i)));
            B.setElement(2,i,(-2.0*d2.getElement(2,i)));
        }
        return(B);
    }

    /* (non-Javadoc)
     * @see lr.ufmg.dees.insane.analysisModel.AnalysisModel#getInternalVarialleOperator(lr.ufmg.dees.insane.util.IMatrix, lr.ufmg.dees.insane.util.IVector, lr.ufmg.dees.insane.util.IMatrix, lr.ufmg.dees.insane.util.IMatrix)
     */
    public IMatrix getInternalVariableOperator(IMatrix d, IMatrix d2, IVector n, IMatrix c, IMatrix u){
        IMatrix B = new IMatrix(3, n.getSize());
        B.setZero();
        for(int i = 0; i < n.getSize(); i++){
            B.setElement(0,i,(-d2.getElement(0,i)));
            B.setElement(1,i,(-d2.getElement(1,i)));
            B.setElement(2,i,(-2*d2.getElement(2,i)));
        }
        return(B);
    }
    
    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getType()
     */
    public String getLabel() {
        return "MZCKirchhoffPlate";
    }

    /* (non-Javadoc)
     * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getTransformationMatrix(br.ufmg.dees.insane.util.IMatrix, br.ufmg.dees.insane.util.IMatrix)
     */
	public IMatrix getTransformationMatrix(IMatrix dl, IMatrix cN) {
    	IMatrix transf = new IMatrix(12,12);
    	transf.setIdentity();
        return transf;
	}

    /* (non-Javadoc)
	 * @see br.ufmg.dees.insane.analysisModel.AnalysisModel#getDOFLabels(int)
	 */
    public ArrayList getDOFLabels(int n){
		ArrayList <PointValues> al = new ArrayList<PointValues>();
		PointValues spv = new StringPointValues();
	    spv.addPointValue("Dz");
	    spv.addPointValue("Rx");
	    spv.addPointValue("Ry");
		for(int i=0; i<n; i++) {
			al.add(i,spv);
		}
		return al;
	}

	public ArrayList getDOFLabels() {
		// TODO Auto-generated method stub
		return null;
	}

	public IMatrix getPMatrix() {
		// TODO Auto-generated method stub
		return null;
	}
}
